<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>020-序选择器-区分类型.html</title>
	<style>
		/*p:first-child{
			color: red;
		}*/
		/*p:last-of-child{
			color: red;
		}*/
		/*p:nth-of-type(2){
			color: red;
		}*/
		/*p:nth-of-type(odd){
			color: red;
		}*/
		/*p:nth-of-type(even){
			color: red;
		}*/
		/*p:nth-of-type(3n+0){
			color: red;
		}*/
		/*p:nth-last-of-type(2){
			color: red;
		}*/
		h1:only-of-type{
			color: red;
		}
	</style>
</head>
<body>
	<div>
			<h1>h1</h1>
			<p>01</p>
			<p>02</p>
			<p>03</p>
			<p>04</p>
			<p>05</p>
			<h2>h2</h2>
		</div>	
</body>
</html>